#! /bin/bash

echo "build debug & release first, then run this scripts."

checkError() {
    error=$?

    if [ $error -ne 0 ]; then
        echo "found error: $error"
        exit $error
    fi
}

echo "distributing .dll .pdb .lib .h..."
rm -rf ./dist
mkdir -p ./dist/bin
mkdir -p ./dist/lib
# mkdir -p ./dist

cp ./x64/debug/*.dll ./dist/bin/
cp ./x64/debug/*.pdb ./dist/bin/
cp ./x64/debug/*.lib ./dist/lib/

cp ./x64/release/*.dll ./dist/bin/
cp ./x64/release/*.lib ./dist/lib/

cp -r ./include ./dist/
cp -r ./files ./dist/

# echo "coping to the Qt..."
# cp -rf ./dist/* C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/

# explorer .